
#include "TK.h"

int main(int argc,char* argv[]){
	if(argc<2)
	{
		printf("usage: link1 , link2\n");
		return 0;
	}
	
	Node* head1 = (Node *)malloc(sizeof(Node));
	Node* head2 = (Node*)malloc(sizeof(Node));
	head1->next = NULL;
	head2->next = NULL;
	Node* pend = head1;
	int i = 1;
	while(i<argc)
	{
		if(*argv[i] == ',')//this is a char, cannot ","
		{
			printf("examined!\n");
			pend = head2;
			i++;
			continue;		
		}
		Node* pnew = (Node *)malloc(sizeof(Node));
		pnew->data = *argv[i++];//char* will be necessary!!!
		pnew->next = NULL;
		pend->next = pnew;
		pend = pnew;
	}	
	head1 = head1->next;
	head2 = head2->next;

       	Node* newhead = amalgamate(head1,head2);

	while(newhead)
	{
		printf("%c ",newhead->data);
		newhead = newhead->next;
	}
	printf("\n");
	return 0;
}
